-
-
Notifications
You must be signed in to change notification settings - Fork 132
ActiveRecord::RuntimeRegistry.sql_runtime private API moved #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Started running into this one, would be great to get it merged. |
|
Seeing this as well. 🙏 |
|
We're seeing this too. Would be awesome to get this in soon |
|
bumping again, this is causing errors now: |
|
I created a monkeypatch to fix this in the meantime, based on @rubyroob's excellent work in #249. Stick this in a file in # frozen_string_literal: true
LAST_TESTED_VERSION = '4.18.0'
require 'rails_semantic_logger/version'
unless RailsSemanticLogger::VERSION == LAST_TESTED_VERSION
raise "rails_semantic_logger is version #{RailsSemanticLogger::VERSION} but the monkey patch was last tested on " \
"#{LAST_TESTED_VERSION} - manually check if it can find the sql_runtime module."
end
module RailsSemanticLogger
module ActiveRecord
class LogSubscriber < ActiveSupport::LogSubscriber
def self.runtime=(value)
if ::ActiveRecord::RuntimeRegistry.respond_to?(:stats)
::ActiveRecord::RuntimeRegistry.stats.sql_runtime = value
else
::ActiveRecord::RuntimeRegistry.sql_runtime = value
end
end
def self.runtime
if ::ActiveRecord::RuntimeRegistry.respond_to?(:stats)
::ActiveRecord::RuntimeRegistry.stats.sql_runtime ||= 0
else
::ActiveRecord::RuntimeRegistry.sql_runtime ||= 0
end
end
end
end
end |
|
@zzak |
|
Thank you @rubyroobs! Your patch saved me earlier, just trying to pay it forward. :) |
|
@reidmorrison would it be possible to have it merged sooner rather than later given that rails 8.1 is out? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails 8.1.0 is out, this looks like a neat little patch to rollout
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
This adds a patch from reidmorrison/rails_semantic_logger#276 which we need until support for Rails 8.1 is added officially. Jira-Issue: MAV-2386
|
@reidmorrison more and more people are going to start hitting this on rails 8.1+. This patch is important to have. |
See: rails/rails@7d12071
This change will land in Rails 8.1.